home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-01-29 | 1.4 KB | 38 lines | [TEXT/ToyS] |
- property dNames : ["B", "I", "U", "Centre", "Font", "TD", "P", "HRef", ¬
- "H1", "H2", "H3", "H4", "List", "Item", "Title", "Back Col"]
- property tPrefix : ["<B>", "<I>", "<U>", "<CENTER>", "<FONT SIZE=\"1\">", "<TD>", "<P>", "<A HREF=\"\">", ¬
- "<H1>", "<H2>", "<H3>", "<H4>", "<UL>", "<LI>", "<TITLE>", "<BODY BGCOLOR=\""]
- property tSuffix : ["</B>", "</I>", "</U>", "</CENTER>", "</FONT>", "</TD>", "</P>", "</A>", ¬
- "</H1>", "</H2>", "</H3>", "</H4>", "</UL>", "", "</TITLE>", "\">"]
- property dBounds : [60, 40, 262, 114]
- property gApp : application "ClarisWorks"
-
- dd install with fonts {name:"Geneva", size:9} float above gApp
- tell gApp to activate
- try
- dd make dialog {bounds:dBounds, default item:0, contents:[¬
- b(1), b(2), b(3), b(4), b(5), b(6), b(7), b(8), ¬
- b(9), b(10), b(11), b(12), b(13), b(14), b(15), b(16) ¬
- ], style:sideways palette, name:"HTML", closeable:true}
- repeat
- set i to dd interact with user
- if i = -1 then exit repeat
- try
- tell application "ClarisWorks"
- copy to clipboard
- set the clipboard to (tPrefix's item i) & (the clipboard) & (tSuffix's item i)
- paste
- end tell
- on error
- end try
- end repeat
- set my dBounds to dd get bounds of dialog 1
- on error
- end try
- dd uninstall
-
- on b(i)
- set x to 2 + ((i - 1) mod 4) * 50
- set y to 2 + ((i - 1) div 4) * 18
- return {class:push button, bounds:[x, y, x + 48, y + 16], name:dNames's item i}
- end b